Integrating Label Editor into Third-Party Websites and Internal Information Systems


PrintSpirit provides a set of APIs to integrate Label Designer (SpiritDesigner) into third-party websites or internal information systems, offering comprehensive label editing and printing capabilities at minimal cost. Please refer to the PrintSpirit Open Platform.

For desktop application integration, use Dynamic Link Library API.

Requirements: Integrating PrintSpirit Label Editor requires an enterprise account (internet mode) or installed SpiritCenter (intranet mode). Both modes use identical development methods, differing only in server addresses:

  • Internet mode uses official website: https://www.printspirit.cn
  • Intranet mode uses SpiritCenter IP: http://[installation_IP]:9011 or https://[installation_IP]:9443

Experience

To experience third-party website integration effects, download Third-Party Website Simulator. This program establishes a simulated website locally, implementing label editing/printing through PrintSpirit's third-party APIs.
The program provides source code including Go and PHP examples for integration reference. See Simulated Third-Party Website Usage.

Download simulator (portable executable).

Run in Windows CLI (CMD/PowerShell):

1cd  PATH/to/download_directory  
2./third_site.exe -p 8000 -ip [SpiritCenter_IP]  
  • -p specifies web port (default:8000)
  • -ip specifies SpiritCenter IP (omit for official website)

Access via http://127.0.0.1:8000 to view/manage labels.

Principles

PrintSpirit provides these APIs for enterprise/SpiritCenter users:

PrintSpirit Website or SpiritCenter User Web System Intranet/Internet User Browser 5-third-edit 1-get-acccess-token 2-access-token 3-get-label-list 4-labels

Third-party systems can:

  1. Use get-label-list with subclass parameter for label categorization (ideal for SaaS user separation)
  2. Display previews using <img src="https://www.printspirit.cn/utils/thumb?id=tp_id"/> (official) or <img src="http://IP:9011/utils/thumb?id=tp_id"/> (SpiritCenter)
  3. Edit labels by redirecting/embedding to https://www.printspirit.cn/third-edit?token=__&subclass=__&tpid=__

Note: For internet mode, contact support to enable API after account registration. Use test account: third_test (password: third_test).

Development Tools

SDKs and examples:

  • Go SDK: github.com/printspirit/gosdk
  • Examples: github.com/printspirit/spirit_example (Go/PHP)

Go SDK

1go get github.com/printspirit/gosdk  

Usage:

1site := gosdk.NewThirdApp(HOST_URL, UID, PASS)  
2// API calls  

Example Code

Clone repository:

1git clone https://github.com/printspirit/spirit_example  

Go Version

1cd third_site/go  
2go build  
3./third_site.exe -p 8000 -ip [SpiritCenter_IP]  

PHP Version

1cd third_site/php  
2php -S localhost:8000 main.php  

API Details

get-access-token

GET [host]/api/get-access-token?userid=UID&passwd=PWD

Response:

1{ "rc":"OK", "token":"...", "expirt":3600 }  

new-label

GET [host]/api/new-label?token=...&subclass=...

Parameters:

  • width/height: 0.1mm units
  • dpi: dots/inch
  • refid: template label ID (optional)

Response:

1{ "rc":"OK", "id": "3120f21d-e33c-41ed-8f99-3e259a12f6cd" }  

del-label

GET [host]/api/del-label?token=...&id=LABEL_ID

get-label-list

GET [host]/api/get-label-list?token=...&subclass=...

Response:

1{ "rc":"OK", "data":[ {...} ] }  

get-label-content

GET [host]/api/get-label-content?token=...&tpid=LABEL_ID

Response:

1{ "rc":"OK", "tpinfo":{...}, "data":[...] }  

third-edit

Access URL: [host]/third-edit?token=...&subclass=...&tpid=...

Parameters:

  • tpid: omit for new label

Leave Your Message

login